﻿using NetBrick.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityExample.Common;

class UpdateHandler : PacketHandler
{
    public UpdateHandler() : base(UnityExampleClient.Instance) { }

    public override void Process(object packetData)
    {
        if (((UpdatePacket.Event)packetData).Id == UnityExampleClient.Instance.Id)
            return;
        GameQueue.Instance.QueueAction(() =>
        {
            GameObject.Find(((UpdatePacket.Event)packetData).Id.ToString()).GetComponent<RemotePlayer>().UpdateData((UpdatePacket.Event)packetData);
        });
    }
}